﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ARS.Control.Custom.DataPaging.Attributes;

namespace ARS.Control.Interface
{
    public abstract class IUser
    {
        /// <summary>
        /// 在需要读取当前用户的时候调用
        /// </summary>
        /// <returns></returns>
        public virtual UserInfo GetUserInfo()
        {
            return new UserInfo() {Id = -1};
        }

        /// <summary>
        /// 传入主键，查询用户信息。显示控件需要使用，如不使用可以不实现
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="t"></param>
        /// <returns></returns>
        //public virtual UserInfo GetUserInfoFromKey<T>(T t)
        //{
        //    return null;
        //}

        /// <summary>
        /// 传入form取值
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        public virtual string GetUserShowInfo(ARS.Control.Custom.Entity.Fields.Field form)
        {
            return form.Value.ToString();
        }
    }
}
